package JVM.reference;

import java.lang.ref.SoftReference;
import java.util.ArrayDeque;
import java.util.Deque;

/**
 * @author 曹见朋
 * @create 2024-06-19-19:45
 */
public class SoftReferenceDemo1 {

    public static void main(String[] args) {
        byte[] bytes1 = new byte[100 * 1024 * 1024];

        SoftReference<byte[]> softReference = new SoftReference<>(bytes1);
        bytes1 = null;
        System.out.println(softReference.get());
        byte[] bytes2 = new byte[100 * 1024 * 1024];
        System.out.println(softReference.get());
        Deque deque = new ArrayDeque();

    }
}
